package com.mitaotao._1_语法._3_分支._3_if判断;

import java.util.Scanner;

public class _09_2_水仙花数_三目运算符 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入三位数字，为您判断是否是水仙花数");
        int num,bai,shi,ge;
        num = scanner.nextInt();
        bai = 0;
        shi = 0;
        ge = 0;

        bai = num/100;
        shi = num/10 %10;
        ge =  num%10;
        System.out.println(bai*bai*bai+shi*shi*shi+ge*ge*ge == num?"该数字是水仙花数":"该数字不是水仙花数");

    }
}
